home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 15 / macformat_15.iso / C de cerca / Codewarrior Lite / MacOS Support / Headers / ANSI Headers / istream < prev    next >
Text File  |  1995-12-29  |  3KB  |  114 lines

  1. // istream standard header
  2. #ifndef _ISTREAM_
  3. #define _ISTREAM_
  4. #include <streambuf>
  5.  
  6. #if __MWERKS__
  7. #pragma options align=mac68k
  8.  
  9. #if __CFM68K__ && __USING_IMPORTED_ANSI__
  10. #pragma import on
  11. #endif
  12. #endif
  13.  
  14.         // class istream
  15. class istream : virtual public ios {
  16. public:
  17.     istream(streambuf *_S)
  18.         : _Chcount(0) { init(_S); }
  19.     istream(_Uninitialized)
  20.         : ios(_Noinit) {}
  21.     virtual ~istream();
  22.     _Bool ipfx(int = 0);
  23.     void isfx()
  24.         {}
  25.     istream& operator>>(istream& (*_F)(istream&))
  26.         {return ((*_F)(*this)); }
  27.     istream& operator>>(ios& (*_F)(ios&))
  28.         {(*_F)(*(ios *)this); return (*this); }
  29.     istream& operator>>(char *);
  30.     istream& operator>>(unsigned char *_S)
  31.         {return (*this >> (char *)_S); }
  32.     istream& operator>>(char&);
  33.     istream& operator>>(unsigned char& _C)
  34.         {return (*this >> *(char *)&_C); }
  35.     istream& operator>>(short&);
  36.     istream& operator>>(unsigned short&);
  37.     istream& operator>>(int&);
  38.     istream& operator>>(unsigned int&);
  39.     istream& operator>>(long&);
  40.     istream& operator>>(unsigned long&);
  41.     istream& operator>>(float&);
  42.     istream& operator>>(double&);
  43.     istream& operator>>(long double&);
  44.     istream& operator>>(void *&);
  45.     istream& operator>>(streambuf&);
  46.     int get();
  47.     istream& get(char *, int, char = '\n');
  48.     istream& get(unsigned char *_S, int _N, char _D = '\n')
  49.         {return(get((char *)_S, _N, _D)); }
  50.     istream& get(char&);
  51.     istream& get(unsigned char& _C)
  52.         {return (get((char&)_C)); }
  53.     istream& get(streambuf&, char = '\n');
  54.     istream& getline(char *, int, char = '\n');
  55.     istream& getline(unsigned char *_S, int _N, char _D = '\n')
  56.         {return(getline((char *)_S, _N, _D)); }
  57.     istream& ignore(int = 1, int = EOF);
  58.     istream& read(char *, int);
  59.     istream& read(unsigned char *_S, int _N)
  60.         {return(read((char *)_S, _N)); }
  61.     int peek();
  62.     istream& putback(char);
  63.     istream& unget();
  64.     int gcount() const
  65.         {return (_Chcount); }
  66.     int sync();
  67. #if _HAS_SIGNED_CHAR
  68.     istream& operator>>(signed char *_S)
  69.         {return (*this >> (char *)_S); }
  70.     istream& operator>>(signed char& _C)
  71.         {return (*this >> *(char *)&_C); }
  72.     istream& get(signed char *_S, int _N, char _D = '\n')
  73.         {return (get((char *)_S, _N, _D)); }
  74.     istream& get(signed char& _C)
  75.         {return (get((char&)_C)); }
  76.     istream& getline(signed char *_S, int _N, char _D = '\n')
  77.         {return (getline((char *)_S, _N, _D)); }
  78.     istream& read(signed char *_S, int _N)
  79.         {return (read((char *)_S, _N)); }
  80. #endif /* _HAS_SIGNED_CHAR */
  81. protected:
  82.     int _Getffld(char [_MAX_EXP_DIG + _MAX_SIG_DIG + 16]);
  83.     int _Getifld(char [_MAX_INT_DIG], _Bool = 0);
  84. private:
  85.     int _Chcount;
  86.     };
  87.         // manipulators
  88. istream& ws(istream&);
  89.  
  90. #if __MWERKS__
  91. #if __CFM68K__ && __USING_IMPORTED_ANSI__
  92. #pragma import reset
  93. #endif
  94.  
  95. #pragma options align=reset
  96. #endif
  97.  
  98. #endif
  99.  
  100. /*
  101.  * Copyright (c) 1994 by P.J. Plauger.  ALL RIGHTS RESERVED. 
  102.  * Consult your license regarding permissions and restrictions.
  103.  */
  104.  
  105. /* Change log:
  106.  * 1994-06-04: PlumHall baseline
  107.  * 1994-09-30: Applied diffs for Fri Aug 26 00:51:20 1994
  108.  * 1994-10-07: Inserted MW changes.
  109.  * 1994-10-14: XL04 change istream(streambuf *_S) to init derived 
  110.  */
  111.  
  112. /* Change log:
  113.  */
  114.